package org.tech4j.edi.common.entity;

import java.util.Map;
import java.util.Objects;

/**
 * @program: tech4j
 * @description: 业务类型
 * @author: YuKai Fan
 * @create: 2025/3/7 09:55
 **/
public class RetryBizType {
    /**
     * 业务类型
     */
    private Integer type;

    /**
     * 业务类型描述
     */
    private String desc;

    /**
     * 是否并行
     */
    private Boolean parallel;


    private Integer tableIndex;

    /**
     * 扩展字段
     */
    private Map<String, String> extraField;


    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public Boolean getParallel() {
        return parallel;
    }

    public void setParallel(Boolean parallel) {
        this.parallel = parallel;
    }

    public Integer getTableIndex() {
        return tableIndex;
    }

    public void setTableIndex(Integer tableIndex) {
        this.tableIndex = tableIndex;
    }

    public Map<String, String> getExtraField() {
        return extraField;
    }

    public void setExtraField(Map<String, String> extraField) {
        this.extraField = extraField;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        RetryBizType that = (RetryBizType) o;
        return Objects.equals(type, that.type) && Objects.equals(desc, that.desc) && Objects.equals(parallel, that.parallel) && Objects.equals(tableIndex, that.tableIndex) && Objects.equals(extraField, that.extraField);
    }

    @Override
    public int hashCode() {
        return Objects.hash(type, desc, parallel, tableIndex, extraField);
    }

    @Override
    public String toString() {
        return "RetryBizType{" +
                "type=" + type +
                ", desc='" + desc + '\'' +
                ", parallel=" + parallel +
                ", tableIndex=" + tableIndex +
                ", extraField=" + extraField +
                '}';
    }
}
